package Action;

import org.hibernate.Session;
import org.hibernate.Transaction;

import hibconfig.HibernateSessionFactory;
import entity.Student;

public class DelStudent {
 private String stuid;

public String getStuid() {
	return stuid;
}

public void setStuid(String stuid) {
	this.stuid = stuid;
}
 public String execute(){
	 Session session=HibernateSessionFactory.getSession();
     Transaction tran=session.beginTransaction();
     Student stu=(Student) session.get(Student.class,stuid);
     session.delete(stu);
     tran.commit();
     session.close();
	 return "success";
 }
}
